var React = require('react');
var ReactDOM = require('react-dom');



//fetch请求
import promiseMiddleware from 'redux-promise';
import { createStore, combineReducers,applyMiddleware  } from 'redux';
import fetch from 'isomorphic-fetch';
import fetchReducer from './reducers/fetchReducer';
const store = createStore(fetchReducer,applyMiddleware(promiseMiddleware));

//react-router路由部分引入
var Router = require('react-router').Router;
var Route = require('react-router').Route;
var hashHistory = require('react-router').hashHistory;
var IndexRoute = require('react-router').IndexRoute;

//引入子模块
var Home = require('./build/Home')
var Header = require('./build/Header')
var Carousel = require('./build/Carousel')
var Classify=require('./build/Classify')
var List=require('./build/List')
var Megagame=require('./build/Megagame')
var Download=require('./build/Download')
var Register=require('./build/Register')
var Login=require('./build/Login')
var Details=require('./build/Details')
var Search=require('./build/Search')
var Myself = require('./build/Myself')

var Index = React.createClass({
    render: function() {
        return ( 
            <Router history={hashHistory}>
			    <Route path="/" component={Home}/>
                <Route path="Classify" component={Classify}/>
                <Route path="register" component={Register}/>   
                <Route path="login" component={Login}/> 
                <Route path="List" component={List}/>
                <Route path="details" component={Details}/>
                <Route path="Megagame" component={Megagame}/>
                <Route path="Download" component={Download}/>
                <Route path="Search" component={Search}/>
                <Route path="myself" component={Myself}/>                 
			</Router>
        )
    }
})

ReactDOM.render( < Index / > , document.getElementById('app'));